// 聚焦第一个 input 元素
import { nextTick } from "vue"
export const afocus = {
    mounted(el, binding, vnode) {
        console.log(`binding 👉`, binding)
        console.log(`vnode 👉`,vnode)
        const inputel = el.querySelectorAll("input")[0]
        console.log(`inputel 👉`, inputel)
        const handler = event => {
            const target = event.target
            // console.log(`target 👉`, target)
            // console.log(`target.value 👉`, target.value)
            // binding.value(target.value);
        }
        inputel.addEventListener("focus", handler)
        return () => {
            inputel.removeEventListener("focus", handler)
        }
    },
    updated: (el, binding) => {},
}

export default afocus
